/*
 * @Author: intellectual-seeker 3336339701@qq.com
 * @Date: 2025-08-27 16:46:12
 * @LastEditors: intellectual-seeker 3336339701@qq.com
 * @LastEditTime: 2025-08-27 20:45:30
 * @FilePath: /code/lesson30/testPthread.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <iostream>
using namespace std;
#include <pthread.h>
#include <unistd.h>

void* newthreadrun(void* arg)
{
    while(true)
    {
        cout << "this is thread" << endl;
        sleep(1);
    }
}

int main()
{
    pthread_t tid;
    pthread_create(&tid, nullptr, newthreadrun, nullptr);

    while(true)
    {
        cout << "this is main" << endl;
        sleep(1);
    }

    return 0;
}